package com.gitee.wsl.base

import com.gitee.wsl.ext.base.Flag
import com.gitee.wsl.ext.base.FlagAction

open class Warp<T>(val data:T) {

    override fun hashCode(): Int {
        return data?.hashCode() ?: 0
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is Warp<*>) return false

        if (data != other.data) return false

        return true
    }
}

open class WarpWithFlag<T>(data: T,val flag: Flag = Flag()):Warp<T>(data),FlagAction by flag

class ItemFlag<T>(id:T):WarpWithFlag<T>(id)

